<?php
namespace app\admin\validate;

use think\Validate;

class Model extends Validate
{
         protected $rule =   [
            'model_name'  => 'require|max:20|unique:model',
            'table_name'   => 'require|max:20|unique:model',
            'status' =>'require|number',
            
        ];

        protected $message  =   [
           'model_name.require' =>'模型名称不得为空！',
           'model_name.max'   =>'模型名称不得超过20个字符',
           'model_name.unique' =>'模型名称不得重复',

           'table_name.require' =>'附加表名不得为空！',
           'table_name.max'   =>'附加表名不得超过20个字符',
           'table_name.unique' =>'附加表名不得重复',

           'status' => '开启状态不得为空！',
           'status' =>'开启状态必须是数字',



        ];

        protected $scene = [
            'edit'  =>  ['model_name','table_name','status'],
            'add'  =>  ['model_name','table_name','status'],
        ];

}












?>